<template>
  <div>
    <el-radio v-for="(item, index) in attrs.options" :key="index" v-model="val" :label="item.value">{{ item.label }}</el-radio>
  </div>
</template>

<script>
export default {
  name: 'MsuiRadio',
  props: {
    attrs: {
      type: Object,
      default: () => {
        return {}
      }
    },
    value: {
      type: Number | String | Boolean,
      default: ''
    }
  },
  computed: {
    val: {
      get() {
        return this.value
      },
      set(val) {
       if(this.attrs.changeHandler) {
        this.attrs.changeHandler(val)
       }
       this.$emit('input', val)
      },
    }
  }
}
</script>